
/**
 *
 *@Author:yangwenbo
 *@Date:2021/5/17 18:25
 ***/
const crypto = require('crypto');
function encrypto( str, secret ) {
    const cipher = crypto.createCipher('laiba',secret)
    let enc  = cipher.update( str, 'hex','utf8');
    enc  += cipher.final('utf8')
    return enc
}
function decrypt( str, secret ) {
    const decipher = crypto.createDecipher('aes192', secret);
    let dec = decipher.update(str, 'hex', 'utf8');
    dec += decipher.final('utf8');
    return dec;

}
module.exports = {
    encrypto,
    decrypt
}